<template>
  <div class="home">
    <p>{{count}}</p>
    <p>{{count1}}</p>
    <button @click="increment">+</button>
    <button @click="decrement">-</button>
    <button @click="test">test</button>
  </div>
</template>

<script>
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default {
  name: 'home',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App',
      count2: 1234
    }
  },
  computed: {
    count () {
      return this.$store.state.count
    },
    count1 () {
      return this.count2
    }
  },
  methods: {
    increment () {
      this.$store.commit('increment')
    },
    decrement () {
      this.$store.commit('decrement')
    },
    test () {
      this.count2++
    }
  },
  created () {
    Vue.set(this.$store, 'name', 'testSet')
    console.log(this.$store)
  }
}
</script>

